let data = `{
    "code": 200,
    "msg": "成功",
    "data": [
        {
            "date": "20211201",
            "res": [
                {
                    "system_id": "SMART",
                    "system_name": "智能助理",
                    "total_opened_users": 26607,
                    "new_users": 12,
                    "active_users": 7497,
                    "total_hits": 81008,
                    "source_table": "mer_user_askreq_log"
                },
                {
                    "system_id": "QZX",
                    "system_name": "情报系统",
                    "total_opened_users": 79,
                    "new_users": 0,
                    "active_users": 1,
                    "total_hits": 1909,
                    "source_table": "qzx_base_logs_bdp"
                },
                {
                    "system_id": "YRYD",
                    "system_name": "一人一档",
                    "total_opened_users": 9362,
                    "new_users": 21,
                    "active_users": 847,
                    "total_hits": 59118,
                    "source_table": "nb_logs_bdp"
                }
            ]
        },
        {
            "date": "20211202",
            "res": [
                {
                    "system_id": "SMART",
                    "system_name": "智能助理",
                    "total_opened_users": 26608,
                    "new_users": 10,
                    "active_users": 7269,
                    "total_hits": 75273,
                    "source_table": "mer_user_askreq_log"
                },
                {
                    "system_id": "QZX",
                    "system_name": "情报系统",
                    "total_opened_users": 79,
                    "new_users": 0,
                    "active_users": 5,
                    "total_hits": 3873,
                    "source_table": "qzx_base_logs_bdp"
                },
                {
                    "system_id": "YRYD",
                    "system_name": "一人一档",
                    "total_opened_users": 9390,
                    "new_users": 28,
                    "active_users": 854,
                    "total_hits": 69452,
                    "source_table": "nb_logs_bdp"
                }
            ]
        }
    ]
}`

function fit(response) {
  let resData = JSON.parse(response).data;
  let res = {};
  let xAxisData = []
  let seriesData = []
  let smartArr = []
  let QZXArr = []
  let YRYDArr = []
  for(let item of resData){
    xAxisData.push(item.date);
    item.res.map((m) => {
      if (m.system_id === 'SMART'){
        smartArr.push(m.active_users)
      }else if (m.system_id === 'QZX'){
        QZXArr.push(m.active_users)
      }else if (m.system_id === 'YRYD'){
        YRYDArr.push(m.active_users)
      }
    })
  }
  seriesData.push({
    "name": "智能助理",
    "type": "line",
    "data": smartArr
  });
  seriesData.push({
    "name": "情报系统",
    "type": "line",
    "data": QZXArr
  });
  seriesData.push({
    "name": "一人一档",
    "type": "line",
    "data": YRYDArr
  });
  return {
    xAxisData,
    seriesData
  }
}


function fit1(response) {
  let resData = JSON.parse(response).res.system;
}

console.log(fit(data));

/**
 * 处理表格返回数据
 */
function render(data, type, rowData){
  if (data.rowData){
    return `<p style="color: red;">${data.formatVal}</p>`
  }
}